import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.shape.Polygon;
import javafx.scene.paint.Color;
import javafx.collections.ObservableList;

public class Test extends Application {
	public void start(Stage stage) {
		final double radius=50;
		final double centerX=100;
		final double centerY=100;
		Polygon polygon=new Polygon();
		polygon.setFill(Color.YELLOW);
		polygon.setStroke(Color.BLACK);
		ObservableList<Double> list=polygon.getPoints();
		for(int i=0;i<6;i++) {
			list.add(centerX + radius * Math.cos(i*2*Math.PI/6));
			list.add(centerY + radius * Math.sin(i*2*Math.PI/6));
		}

		Pane pane=new Pane();
		pane.getChildren().add(polygon);

		Scene scene=new Scene(pane,200,200);

		stage.setScene(scene);
		stage.setTitle("polygon test");
		stage.show();
	}
}
